package com.hf.work03;

/**
 * @author Lenovo-Healer
 */
public class Company {

    /**
     * 员工数组
     */
    ColaEmployee[] colaEmployees;

    public Company() {

        //固定工资员工
        SalariedEmployee se = new SalariedEmployee("张三", 4, 5500);
        //小时工员工
        HourlyEmployee he = new HourlyEmployee("李四", 4, 22, 166);
        //销售员
        SalesEmployee salesEmployee = new SalesEmployee("王五", 3, 12000, 0.3);

        colaEmployees = new ColaEmployee[]{se,he,salesEmployee};
    }

    /**
     * 打印员工
     * @param month 工资月份
     */
    public void pCompyee(int month){
        if(colaEmployees != null && colaEmployees.length > 0){
            for (ColaEmployee col : colaEmployees){
                col.printComployee(month);
            }
        }else {
            System.out.println("没有可打印员工！");
        }
    }

}
